package com.model.project;

import javax.persistence.CascadeType;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.GeneratedValue;
import javax.persistence.GenerationType;
import javax.persistence.Id;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.TableGenerator;

import com.core.utils.LocalizableString;
import com.model.user.User;


@Entity
public class TeamMemberCategory {

	private User    user;
	// private UserRole userRole;

	private Integer id;



	@Id
	@TableGenerator(name = "generatorUserCategory", table = "Generators", pkColumnName = "generatorName", pkColumnValue = "generatorUserCategory", allocationSize = 1)
	@GeneratedValue(strategy = GenerationType.TABLE, generator = "generatorUserCategory")
	public Integer getId () {

		return id;
	}



	public void setId ( Integer id ) {

		this.id = id;
	}



	@ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	@JoinColumn(nullable = true, updatable = true)
	public User getUser () {

		return user;
	}



	public void setUser ( User user ) {

		this.user = user;
	}



	// @ManyToOne(cascade = CascadeType.ALL, fetch = FetchType.EAGER)
	// @JoinColumn(nullable = true, updatable = true)
	// public UserRole getUserRole () {
	//
	// return userRole;
	// }
	//
	//
	//
	// public void setUserRole ( UserRole userRole ) {
	//
	// this.userRole = userRole;
	// }



	public String localizableDescription () {

		return LocalizableString.sharedInstance().localizable("entity.UserCategory.description");
	}

}
